package edu.chl.jadetalk.business.upload;

import javax.ejb.Local;

/**
 *
 * @author Erik
 */
@Local
public interface ImageDataManagerBeanLocal {
    
    /**
     * Returns the image, either from cache or the remote FTP server
     * @param filename
     * @return
     * @throws NoSuchImageException 
     */
    public byte[] getImage(String filename) throws NoSuchImageException;
    
    /**
     * Saves the image to cache. (Separate from uploadImage allowing the actual uploading to be done asynchronously)
     * @param image
     * @param filename 
     */
    public void saveImageToCache(String filename, byte[] image);

    /***
     * Uploads the image asynchronous to the FTP server
     * @param filename
     * @param image 
     */
    public void uploadImage(String filename, byte[] image);
    
    public String getFileName(byte[] image);
}
